#define _CRT_SECURE_NO_WARNINGS 1

//#include <stdio.h>
//#include <string.h>
//#include <assert.h>
//
//
//void* my_memcpy(void* dest, const void* src, size_t num);
//
//int main()
//{
//	int arr1[10] = {0,1,2,3,4,5,6,7,8,9};
//	int arr2[20] = { 0 };
//	int i = 0;
//	for (i = 0; i < sizeof(arr1) / sizeof(arr1[0]); i++)
//	{
//		printf("%d ", arr1[i]);
//	}
//	printf("\n");
//	my_memcpy(arr1 + 3, arr1, 20);
//	for (i = 0; i < sizeof(arr1) / sizeof(arr1[0]); i++)
//	{
//		printf("%d ", arr1[i]);
//	}
//	return 0;
//}
//
////int main()
////{
////	int arr1[10] = { 0,1,2,3,4,5,6,7,8,9 };
////	int arr2[20] = { 0 };
////	int i = 0;
////	for (i = 0; i < sizeof(arr2) / sizeof(arr2[0]); i++)
////	{
////		printf("%d ", arr2[i]);
////	}
////	printf("\n");
////	memcpy(arr2, arr1 + 1, 20);
////	for (i = 0; i < sizeof(arr2) / sizeof(arr2[0]); i++)
////	{
////		printf("%d ", arr2[i]);
////	}
////	return 0;
////}
//
//
//void* my_memcpy(void* dest, const void* src, size_t num)
//{
//	const void* ret = dest;
//	assert(dest && src);
//	while (num--)
//	{
//		*(char*)dest = *(char*)src;
//		dest = (char*)dest + 1;
//		src = (char*)src + 1;
//	}
//	return ret;
//}
//
//void* my_memmove(void* dest, const void* src, size_t num)
//{
//	const void* ret = dest;
//	assert(dest && src);
//	if (dest < src)
//	{
//		while (num--)
//		{
//			*(char*)dest = *(char*)src;
//			dest = (char*)dest + 1;
//			src = (char*)src + 1;
//		}
//	}
//	else
//	{
//		while (num--)
//		{
//			*((char*)dest + num)= *((char*)src + num);
//		}
//	}
//	return ret;
//}

//#include <stdio.h>
//#include <string.h>
//int main()
//{
//	char str[] = "hello world";
//	memset(str+5, 'x', 6);
//	printf(str);
//	return 0;
//}


#include <stdio.h>
#include <string.h>
int main()
{
	char buffer1[] = "DWgaOtP12df0";
	char buffer2[] = "DWGAOTP12DF0";
	int n;
	n = memcmp(buffer1, buffer2, sizeof(buffer1));
	if (n > 0)
		printf("'%s' is greater than '%s'.\n", buffer1, buffer2);
	else if (n < 0)
		printf("'%s' is less than '%s'.\n", buffer1, buffer2);
	else
		printf("'%s' is the same as '%s'.\n", buffer1, buffer2);
	return 0;
}
